www.gusucode.com > 星梦奇缘交友网 1 > 星梦奇缘交友网 1.0源码程序/love/userbook.asp
<!--#include file=conn.asp--> <!--#include file=config.asp--> <!--#include file=const.asp--> <!--#include file=char.asp--> <% '========================================================= ' File: userbook.asp ' Version:3.0 ' Date: 2005-10-4 ' Script Written by xmrxw '========================================================= ' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved. ' Web: http://www.xmrxw.com,http://www.xmzxw.com ' Email: info@mssky.com,super@mssky.com ' QQ:10689579 Msn:zdlmicr@hotmail.com '========================================================= dim ClassID ClassID=checkStr(trim(request("ClassID"))) if ClassID="" or not isInteger(ClassID) then Errmsg=Errmsg+"<br>"+"<li>类参数错误。" founderr=true else ClassID=Clng(ClassID) end if response.buffer=true if ClassID=1 then stats="约会留言" elseif ClassID=2 then stats="站内留言" elseif ClassID=3 then stats="速配留言" elseif ClassID=4 then stats="聚会留言" end if call nav() if not founduser then Errmsg=Errmsg+"<br>"+"<li>您还没有登陆,请登陆后进行修改。" founderr=true end if if founderr then call Mslove_error() else call tumppages()'翻页处理 strFileName="userbook.asp?ClassID="&ClassID&"" %><table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="596" height="74" background="Skins/21cn/bg4.gif"> </td> <td width="154" background="Skins/21cn/bg4.gif"><img src="Skins/21cn/mycount.gif" width="230" height="50"></td> </tr> </table> <TABLE width=750 border=0 align="center" cellPadding=0 cellSpacing=0 bgColor=#ffffff id=Table2> <TBODY> <TR> <TD width=8><IMG height=8 src="skins/21cn/msg_topLift.gif" width=8></TD> <TD background=skins/21cn/msg_top.gif></TD> <TD width=8><IMG height=8 src="skins/21cn/msg_topright.gif" width=8></TD> </TR> <TR> <TD width=8 background=skins/21cn/msg_Lift.gif></TD> <TD bgColor=#f1fcff> <TABLE id=Table3 cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD width="57%" height="25" colSpan=3 align=left><FONT class=title_1 face=宋体>我的控制面板</FONT></TD> </TR> <TR> <TD background=skins/21cn/hr_msg.gif colSpan=3 height=1></TD> </TR> <TR> <TD style="LINE-HEIGHT: 15pt" colSpan=3 height=22><table width="100%" border="0" align=center cellpadding=0 cellspacing=0> <tr> <td width=12% height=25 id=tabletitlelink><a href=mycount.asp>我的帐号</a></td> <td width=11% id=tabletitlelink><a href=mymodify.asp>基本资料</a></td> <td width=11% id=tabletitlelink><a href=modifypsw.asp>密码修改</a></td> <td width=11% id=tabletitlelink><a href=modifyfd.asp>交友资料</a></td> <td width=11% id=tabletitlelink><a href=modifyadd.asp>联系资料</a></td> <td width=11% id=tabletitlelink><a href=usersms.asp>短信服务</a></td> <td width=11% id=tabletitlelink><a href=friendlist.asp>我的好友</a></td> <td width=11% id=tabletitlelink><a href=favlist.asp>我的收藏</a></td> <td width=11% id=tabletitlelink><a href=userphoto.asp>我的相册</a></td> </tr> </table></TD> </TR> </TBODY> </TABLE></TD> <TD width=8 background=skins/21cn/msg_right.gif></TD> </TR> <TR> <TD><IMG height=8 src="skins/21cn/msg_buttomLift.gif" width=8></TD> <TD background=skins/21cn/msg_buttom.gif></TD> <TD><IMG height=8 src="skins/21cn/msg_buttomRight.gif" width=8></TD> </TR> </TBODY> </TABLE><% Select Case Trim(Request("action")) Case "清空" Stats="清空留言" Call AllDeldata() Case "删除" Stats="删除留言" Call Deldata() Case "add" Call add() Case "saveadd" Stats="保存留言" Call saveadd() Case "view" Stats="查看留言" Call view() case else call main() End Select if founderr then call Mslove_error() end if call activeonline() call footer() sub main() %> <br> <TABLE width=750 border=0 align="center" cellPadding=0 cellSpacing=0 bgColor=#ffffff id=Table2> <TBODY> <TR> <TD width=8><IMG height=8 src="skins/21cn/msg_topLift.gif" width=8></TD> <TD background=skins/21cn/msg_top.gif></TD> <TD width=8><IMG height=8 src="skins/21cn/msg_topright.gif" width=8></TD> </TR> <TR> <TD width=8 background=skins/21cn/msg_Lift.gif></TD> <TD bgColor=#f1fcff> <TABLE id=Table3 cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD width="57%" height="25" colSpan=3 align=center><strong><%=stats%>列表</strong></TD> </TR> <TR> <TD background=skins/21cn/hr_msg.gif colSpan=3 height=1></TD> </TR> <TR> <TD style="LINE-HEIGHT: 15pt" colSpan=3 height=22> <table width="100%" border="0" align=center cellpadding=3 cellspacing=0 > <form action="userbook.asp" method=POST name="theForm"> <tr align="center"> <td width="7%" height="25" class=tablebody2><strong>状态 </strong></td> <td width="56%" class=tablebody2><strong>主 题</strong></td> <td width="13%" class=tablebody2><strong>发布者</strong></td> <td width="17%" class=tablebody2><strong>时间</strong></td> <td width="7%" class=tablebody2><strong>操作</strong></td> </tr> <%dim NID,FlagR set rs=server.createobject("adodb.recordset") sql="select NID,Title,Addtime,Postname,Flag from Ms_Note where Username='"&trim(membername)&"' and TypeID="&ClassID&" order by addtime desc" rs.Open sql,conn,1,1 if not (rs.eof and rs.bof) then call rspages() do while not rs.eof and page_count<Cint(MaxPerPage) NID=rs("NID") FlagR=rs("Flag")%> <tr align="center"> <td align="center" class=tablebody1> <%if FlagR=1 then response.Write("<font color=blue>已阅</font>") else response.Write("<font color=red>未阅</font>") end if%> </td> <td align="left" class=tablebody1><a href=?action=view&Nid=<%=Nid%>&Classid=<%=Classid%> title=查看信息><%=rs("Title")%></a></td> <td align="center" class=tablebody1><a href=dispuser.asp?username=<%=rs("Postname")%>><%=rs("Postname")%></a></td> <td align="center" class=tablebody1><%=rs("Addtime")%></td> <td align="center" class=tablebody1><input type=checkbox name=id value=<%=NID%>></td> </tr> <%page_count=page_count+1 rs.movenext loop else response.Write("<tr align=""center""> <td colspan=""5"" align=""left"" class=tablebody2>当前没有任何留言。</td></tr>") end if if totalrec>0 then %> <tr align="center"> <td colspan="5" align="left" class=tablebody2> <%call showpage(strFileName)%> </td> </tr> <%end if%> <tr align="right"> <td colspan="5" class=tablebody1>跳转到: <select name=Classid onchange='javascript:submit()'> <option value=1 <%if ClassID=1 then%>selected<%end if%>>约会留言</option> <option value=2 <%if ClassID=2 then%>selected<%end if%>>站内留言</option> <option value=3 <%if ClassID=3 then%>selected<%end if%>>速配留言</option> <option value=4 <%if ClassID=4 then%>selected<%end if%>>聚会留言</option> </select> <input type=button name=action onclick="location.href='?action=add&ClassID=<%=ClassID%>'" value="添加留言"> <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)"> 选中所有显示记录 <input type=submit name=action onclick="{if(confirm('确定清空所有记录吗?')){this.document.theForm.submit();return true;}return false;}" value="清空"> <input type=submit name=action onclick="{if(confirm('确定删除选定的记录吗?')){this.document.theForm.submit();return true;}return false;}" value="删除"> </td> </tr> </form> </table></TD> </TR> </TBODY> </TABLE></TD> <TD width=8 background=skins/21cn/msg_right.gif></TD> </TR> <TR> <TD><IMG height=8 src="skins/21cn/msg_buttomLift.gif" width=8></TD> <TD background=skins/21cn/msg_buttom.gif></TD> <TD><IMG height=8 src="skins/21cn/msg_buttomRight.gif" width=8></TD> </TR> </TBODY> </TABLE> <% end sub sub AllDeldata()''清空 if not (master or standmaster or supermaster) and ClassID=0 then Errmsg=Errmsg+"<li>"+"只有管理员可以管理网站公告。" Founderr=true exit sub end if conn.execute("delete from Ms_Note where TypeID="&ClassID&" and Username='"&trim(membername)&"'") sucmsg=sucmsg+"<br>"+"<li>您已成功清空所有记录。" call Mslove_suc() end sub sub Deldata() dim delid,FixID delid=replace(request("id"),"'","") delid=replace(delid,";","") delid=replace(delid,"--","") delid=replace(delid,")","") fixid=replace(delid,",","") fixid=Trim(replace(fixid," ","")) If Not IsNumeric(fixid) Then Errmsg=Errmsg+"<br><li>错误的参数。" founderr=true End If if delid="" or isnull(delid) then Errmsg=Errmsg+"<li>"+"错误的参数。" Founderr=true end if if not (master or standmaster or supermaster) and ClassID=0 then Errmsg=Errmsg+"<li>"+"只有管理员可以管理网站公告。" Founderr=true exit sub end if if founderr=true then exit sub conn.execute("delete from Ms_Note where TypeID="&ClassID&" and Nid in("&delid&")") sucmsg=sucmsg+"<br>"+"<li>您已成功删除所选定的记录。" call Mslove_suc() end sub sub add()''发送留言 if not (master or standmaster or supermaster) and ClassID=0 then Errmsg=Errmsg+"<li>"+"只有管理员可以添加网站公告。" Founderr=true exit sub end if %> <br> <TABLE width=750 border=0 align="center" cellPadding=0 cellSpacing=0 bgColor=#ffffff id=Table2> <TBODY> <TR> <TD width=8><IMG height=8 src="skins/21cn/msg_topLift.gif" width=8></TD> <TD background=skins/21cn/msg_top.gif></TD> <TD width=8><IMG height=8 src="skins/21cn/msg_topright.gif" width=8></TD> </TR> <TR> <TD width=8 background=skins/21cn/msg_Lift.gif></TD> <TD bgColor=#f1fcff> <TABLE id=Table3 cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD width="57%" height="25" colSpan=3 align=center><%=stats%></TD> </TR> <TR> <TD background=skins/21cn/hr_msg.gif colSpan=3 height=1></TD> </TR> <TR> <TD style="LINE-HEIGHT: 15pt" colSpan=3 height=22><table width="100%" border="0" align=center cellpadding=3 cellspacing=0 > <form action="?action=saveadd" method=POST name="theForm"> <input name="ClassID" type="hidden" id="ClassID" value="<%=ClassID%>"> <tr> <td width="22%" height="5" align="right" class=tablebody1>发布者:</td> <td width="78%" class=tablebody1><input disabled value="<%=trim(membername)%>" name="Postname" size="20"> <input type="hidden" value="<%=trim(membername)%>" name="Postname"> </td> </tr> <tr> <td width="22%" height="6" align="right" class=tablebody1>接收人:</td> <td class=tablebody1><input name="Touser" type="text" id="Touser" value="<%=request("Touser")%>" size="20"></td> </tr> <tr> <td width="22%" height="13" align="right" class=tablebody1>标 题:</td> <td class=tablebody1><input name="title" type="text" id="title"></td> </tr> <tr> <td height="25" align="right" class=tablebody1>内 容:</td> <td height="25" class=tablebody1><textarea name="Content" cols="60" rows="5" id="IDContent"></textarea> <a style=cursor:hand onclick="if (parseInt(IDContent.rows)-3>0)(IDContent.rows=parseInt(IDContent.rows)-3)"><img src="Skins/Default/minus.gif" unselectable="on" border='0'></a> <a style=cursor:hand onclick="if (parseInt(IDContent.rows)+3>3)(IDContent.rows=parseInt(IDContent.rows)+3)"><img src="Skins/Default/plus.gif" unselectable="on" border='0'></a></td> </tr> <tr align="center"> <td height="27" colspan="2" class=tablebody1> <input class=2 type=Submit value="保存" name=Submit> <input class=2 type="reset" name="Clear" value="清除"></td> </tr> </form> </table></TD> </TR> </TBODY> </TABLE></TD> <TD width=8 background=skins/21cn/msg_right.gif></TD> </TR> <TR> <TD><IMG height=8 src="skins/21cn/msg_buttomLift.gif" width=8></TD> <TD background=skins/21cn/msg_buttom.gif></TD> <TD><IMG height=8 src="skins/21cn/msg_buttomRight.gif" width=8></TD> </TR> </TBODY> </TABLE> <%end sub sub saveadd()''保存留言 dim Title,Content,touser,postname Title=checkStr(trim(request("Title"))) Content=checkStr(trim(request("Content"))) touser=checkStr(trim(request("touser"))) Postname=checkStr(trim(request("Postname"))) Classid=checkStr(trim(request("Classid"))) if Classid="" or not isnumeric(Classid) then errmsg=errmsg+"<br>"+"<li>参数错误。" founderr=true end if if not (master or standmaster or supermaster) and ClassID=0 then Errmsg=Errmsg+"<li>"+"只有管理员可以添加网站公告。" Founderr=true exit sub end if if Title="" or strLength(request("Title"))>100 then errmsg=errmsg+"<br>"+"<li>标题不能为空长度不大于100个字符。" founderr=true end if if Content="" or strLength(request("Content"))>300 then errmsg=errmsg+"<br>"+"<li>内容不能为空长度不大于300个字符。" founderr=true end if if touser="" then errmsg=errmsg+"<br>"+"<li>接收信息用户名为空。" founderr=true end if if Postname="" or strLength(request("Postname"))>20 then errmsg=errmsg+"<br>"+"<li>接收对象用户名为空。" founderr=true end if if founderr=true then exit sub conn.execute("Insert into Ms_Note (TypeID,Title,Content,Username,Postname,Flag,Addtime) VALUES ("&Classid&",'"&Title&"','"&Content&"','"&Touser&"','"&Postname&"',0,'"&now()&"')") sucmsg=sucmsg+"<br>"+"<li><b>您已经成功发送信息。" call Mslove_suc() end sub sub view()''查看留言 dim nid Nid=checkStr(trim(request("Nid"))) if Nid="" or not isInteger(Nid) then Errmsg=Errmsg+"<br>"+"<li>参数错误。" founderr=true else Nid=Clng(Nid) end if if classid<>0 then conn.execute("update Ms_Note set Flag=1 where Nid="&Nid&"") end if set rs=server.createobject("adodb.recordset") if classid<>0 then sql="select Title,Content,Addtime,Postname from Ms_Note where Username='"&trim(MemberName)&"' and TypeID="&ClassID&" and Nid="&Nid&"" else sql="select Title,Content,Addtime,Postname from Ms_Note where TypeID="&ClassID&" and Nid="&Nid&"" end if rs.Open sql,conn,1,1 if not (rs.eof and rs.bof) then%> <br> <TABLE width=750 border=0 align="center" cellPadding=0 cellSpacing=0 bgColor=#ffffff id=Table2> <TBODY> <TR> <TD width=8><IMG height=8 src="skins/21cn/msg_topLift.gif" width=8></TD> <TD background=skins/21cn/msg_top.gif></TD> <TD width=8><IMG height=8 src="skins/21cn/msg_topright.gif" width=8></TD> </TR> <TR> <TD width=8 background=skins/21cn/msg_Lift.gif></TD> <TD bgColor=#f1fcff> <TABLE id=Table3 cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD width="57%" height="25" colSpan=3 align=center><strong>>> <%=rs(0)%> <<</strong></TD> </TR> <TR> <TD background=skins/21cn/hr_msg.gif colSpan=3 height=1></TD> </TR> <TR> <TD style="LINE-HEIGHT: 15pt" colSpan=3 height=22><table width="100%" border="0" align=center cellpadding=3 cellspacing=0 > <tr align="center"> <td width="100%" align="left" vAlign="top" class="tablebody1" style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word"><blockquote><%=rs("Content")%></blockquote></td> </tr> <tr align="center"> <td height="26" align="center" valign="top" class=tablebody1><table cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td height="24" align="left"> <b>发布人</b>: <a href=dispuser.asp?username=<%=rs("Postname")%>><%=rs("Postname")%></a></td> <td align="right"><b>发布时间</b>: <%=rs("addtime")%> </td> </tr> </table></td> </tr> </table></TD> </TR> </TBODY> </TABLE></TD> <TD width=8 background=skins/21cn/msg_right.gif></TD> </TR> <TR> <TD><IMG height=8 src="skins/21cn/msg_buttomLift.gif" width=8></TD> <TD background=skins/21cn/msg_buttom.gif></TD> <TD><IMG height=8 src="skins/21cn/msg_buttomRight.gif" width=8></TD> </TR> </TBODY> </TABLE> <%end if rs.close end sub%> </body> </html>